package com.example.baiduai.controller;


import com.example.baiduai.dto.AiDto;
import com.example.baiduai.service.BaiduAIService;
import com.example.baiduai.utils.GsonUtils;
import com.example.baiduai.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/baidu/ai")
@Slf4j
public class BaiduAIController {


    @Autowired
    private BaiduAIService baiduAIService;

    /**
     *  支付检测回调
     * @return
     */
    @PostMapping("/payDetectionCallback")
    public JsonResult payDetectionCallback(@RequestBody AiDto aicVDto){
        log.info("支付检测回调  aicVDt={}"  ,GsonUtils.toJson(aicVDto));
        baiduAIService.payDetectionCallback(aicVDto);
        return JsonResult.success();
    }

}
